package com.xunwulian.base.dao;

import com.xunwulian.base.entity.ConfigEntity;
import com.xunwulian.base.entity.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.validation.constraints.NotNull;
import java.util.List;

@Mapper
public interface ConfigDao {

    Integer save(@Param("entity") ConfigEntity entity);

    void deleteByCode(@Param("code") String code);

    Integer updateByCode(@Param("config") ConfigEntity config);

    ConfigEntity getById(@NotNull @Param("id") String id);

    ConfigEntity getByCode(@NotNull @Param("code") String code);

    List<ConfigEntity> listPageByAll(@Param("page") Page page);

    List<ConfigEntity> listAll();
}
